﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Ooganizer.API;
using Ooganizer.Server;

namespace Ooganizer.Client.UI
{
    /// <summary>
    /// Interaction logic for AddNewWorkspace.xaml
    /// </summary>
    public partial class AddNewWorkspace : Window
    {
        public AddNewWorkspace()
        {
            InitializeComponent();
        }

        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            using (OoganizerState oogyState = new OoganizerState())
            {
                using (OoganizerAPIProxy proxy = oogyState.GetAPIProxy())
                {
                    proxy.API.CreateWorkspace(txtWorkspaceName.Text);
                }
            }

            this.Close();
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
